import static org.junit.Assert.*;

import org.junit.Test;


public class LinkedListInsertTest {

	@Test
	public void testInsert() {
		//instantiate list
		LinkedList l = new LinkedList();
		
		//insert successive values that can be predicted to test against actual values
		l.insert(10);
		l.insert(9);
		l.insert(8);
		l.insert(7);
		l.insert(6);
		l.insert(5);
		l.insert(4);
		l.insert(3);
		l.insert(2);
		l.insert(1);
		l.insert(0);
		
		//instantiate the first node
		Node temp = l.start;
		for(int i = 10; i >= 0; i--){
			if(i != 10){
				//on the first round, start with the first node; for all the rest move to the next node
				temp = temp.getNext();
			}
			
			//ensure that the node is the next lowest numerical value as inserted
			assertEquals(i,temp.getData());
		}
	}

}
